package com.hao.hospital.controller;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.hao.hospital.service.PaymentService;
import com.jfinal.core.Controller;
import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Record;

public class PaymentAction extends Controller {
	/**
	 * 
	 */
	public void countArray() {
		String user_id = getPara("user_id");
		renderJson(PaymentService.me().countArray(user_id));
	}
	//获取资金图数据
	public void EveryMonthUse(){
		Date date=new Date();
		DateFormat format=new SimpleDateFormat("yyyy");
		String time=format.format(date);
		HashMap<String, Object> useOne=PaymentService.me().getEveryMonthUse(1, time);
		HashMap<String, Object> useTwo=PaymentService.me().getEveryMonthUse(2, time);
		Map<String, Object> map=new HashMap<>();
		map.put("userOne", useOne);
		map.put("userTwo", useTwo);
		map.put("year", time);
		renderJson(map);
	}
	/**
	 * 通过患者name查找到患者缴费内容 http请求方式：get
	 */
	public void addrecord() {
		renderJson(PaymentService.me().getPayRecord(1));
	}

	/**
	 * 显示所有交易记录 http请求方式：get
	 */
	public void allinfo() {

	}
}
